<?php
include('top.php');
require_once('pasmy/dbwaarden.php');
if(empty($_SESSION['taal'])) {
	session_destroy();
		Header( "HTTP/1.1 301 Moved Permanently" );
		 
		Header( "Location: login.php" ); 
}
/*echo "dbhost = $dbhost<br>";*/
echo "<br><br>";
$mysql_id = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db, $mysql_id);
$jaartal = date("Y");

if(isset($_POST["jaar"])) {
$waardb = "vnzvrn" . $_POST["jaartal"];


$sql = "CREATE TABLE IF NOT EXISTS `$waardb` (
   `datum` date NOT NULL,
  `ref` varchar(25) NOT NULL,
  `client` varchar(40) NOT NULL,
  `expediteur` varchar(40) NOT NULL,
  `bestemmeling` varchar(40) NOT NULL,
  `plaats` varchar(40) NOT NULL,
  `colis` varchar(10) NOT NULL,
  `pal` varchar(10) NOT NULL,
  `mp` varchar(10) NOT NULL,
  `poids` varchar(10) NOT NULL,
  `prijs` varchar(10) NOT NULL,
  `opmerkingen` varchar(80) NOT NULL,
  `driver` varchar(35) NOT NULL,
  `week` varchar(10) NOT NULL,
  `record` int(11) NOT NULL AUTO_INCREMENT,
  `laadplaats` varchar(120) NOT NULL,
  `cmr` varchar(120) NOT NULL,
  `gasoil` varchar(20) NOT NULL,
  `nrpl` varchar(25) NOT NULL,
  `ligne`varchar(25) NOT NULL,
  KEY `record` (`record`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
";
$res = mysql_query($sql, $mysql_id);
echo "<br /><br /><div style='text-align: center'><h1>Database $waardb created</h1></div>";
}
else {
?>
<form action="dbcreator.php" method="post">
<table align="center" width="40%" border="1">
<tr><td colspan="2" class="delsaux2"><?php echo $dbaanmaken[$taal];?></td></tr>
<tr><td width="30%"><strong><?php echo $dbaanjaar[$taal];?> </strong></td><td width="10%"><input type="text" name="jaartal"  value="<?php echo $jaartal;?>" /></td></tr>
<tr><td colspan="2"><div style="text-align: center"><br /><input type="submit" name="jaar" value="<?php echo $aanmaken[$taal];?>"/></div></td></tr>
</table>
</form>
<?php
}
include('footer.php');
?>